package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
	"ssd/models"
)

type Qwd struct {
	beego.Controller
}

func (c *Qwd) List() {
	c.Ctx.Output.Header("Access-Control-Allow-Origin", "*")
	var qq []models.Qwd
	err := models.DB.Find(&qq).Error
	if err != nil {
		c.Data["json"] = map[string]interface{}{
			"code": 200,
			"msg":  "查询失败",
			"data": nil,
		}
		c.ServeJSON()
	} else {
		c.Data["json"] = map[string]interface{}{
			"code": 200,
			"msg":  "查询成功",
			"data": qq,
		}
		c.ServeJSON()
	}
}
